home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / TUTORIAL.BIN / NumberField.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-01-30  |  1.7 KB  |  42 lines

  1. package symantec.itools.db.net;
  2.  
  3. import java.io.DataInputStream;
  4. import java.io.DataOutputStream;
  5. import java.io.IOException;
  6. import symjava.sql.SQLException;
  7.  
  8. class NumberField extends Field {
  9.    void read(DataInputStream is) throws SQLException, IOException, ErrorException {
  10.       super.read(is);
  11.       if (!super._null) {
  12.          ServerObject obj = (ServerObject)NetClass.getNextObject(is);
  13.          if (obj.getType() != 51 && obj.getType() != 52) {
  14.             ((ServerObject)this).onObjectError(obj);
  15.          } else {
  16.             this.readData(obj);
  17.          }
  18.       }
  19.  
  20.       ServerObject obj = (ServerObject)NetClass.getNextObject(is);
  21.       if (obj.getType() != 50) {
  22.          ((ServerObject)this).onObjectError(obj);
  23.       }
  24.  
  25.    }
  26.  
  27.    void write(DataOutputStream os) throws IOException {
  28.       super.write(os);
  29.       this.writeData(os);
  30.       EOT eot = new EOT();
  31.       eot.write(os);
  32.    }
  33.  
  34.    void readData(ServerObject data) throws SQLException, IOException, ErrorException {
  35.       throw new IOException("Internal Error: Method not implemented");
  36.    }
  37.  
  38.    void writeData(DataOutputStream os) throws IOException {
  39.       throw new IOException("Internal Error: Method not implemented");
  40.    }
  41. }
  42.